if (modifier && modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES)
{
if (ostree_repo_get_mode (self) == OSTREE_REPO_MODE_ARCHIVE)
- self->generate_sizes = TRUE;
+ {
+ self->generate_sizes = TRUE;
+
+ /* Clear any stale data in the object sizes hash table */
+ if (self->object_sizes != NULL)
+ g_hash_table_remove_all (self->object_sizes);
+ }
else
g_debug ("Not generating sizes for non-archive repo");
}
g_variant_builder_add (builder, "{sv}", "ostree.sizes",
g_variant_builder_end (&index_builder));
+
+ /* Clear the object sizes hash table for a subsequent commit. */
+ g_hash_table_remove_all (self->object_sizes);
}
return g_variant_ref_sink (g_variant_builder_end (builder));
guint zlib_compression_level;
GHashTable *loose_object_devino_hash;
GHashTable *updated_uncompressed_dirs;
+
+ /* FIXME: The object sizes hash table is really per-commit state, not repo
+ * state. Using a single table for the repo means that commits cannot be
+ * built simultaneously if they're adding size information. This data should
+ * probably be in OstreeMutableTree, but that's gone by the time the actual
+ * commit is constructed. At that point the only commit state is in the root
+ * OstreeRepoFile.
+ */
GHashTable *object_sizes;
/* Cache the repo's device/inode to use for comparisons elsewhere */